// 定义数据模型
import mongoose from 'mongoose'
const Schema = mongoose.Schema
const Cart = new Schema({
  id: { // 产品id
    type: String,
    require: true
  },
  detail: { // 详细信息
    type: Array,
    require: true
  },
  cartNo: {
    type: String,
    require: true
  },
  user: { // 用户
    type: String,
    require: true
  },
  time: { // 购物车创建时间
    type: Date,
    require: true
  }
})

export default mongoose.model('Cart', Cart)
